package com.three.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.three.entity.Shopkeeperchange;
import com.three.mapper.ShopkeeperchangeMapper;
import com.three.service.ShopkeeperchangeService;
import com.three.vo.R;
import com.three.vo.ShopkeeperchangeVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ShopkeeperchangeServiceImpl implements ShopkeeperchangeService {
    @Autowired
    private ShopkeeperchangeMapper shopkeeperchangeMapper;
    //查询所有调动信息
    @Override
    public R getAll(Integer currentPage, Integer pageSize, ShopkeeperchangeVo shopkeeperchangeVo) {
        //开启分页
        PageHelper .startPage(currentPage,pageSize);
        List<Shopkeeperchange> shopkeeperchanges = shopkeeperchangeMapper.selectAll(shopkeeperchangeVo);
        //封装分页数据
        PageInfo<Shopkeeperchange> pageInfo = new PageInfo<>(shopkeeperchanges);
        return R.ok(pageInfo);
    }
}
